/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package gestionmagasins_aspectj_junit_patterns.model;

import sun.reflect.generics.reflectiveObjects.NotImplementedException;

/**
 *
 * @author Michael
 */
public class ArticleFactory {
    
   static int sequenceId;
   
   public static Article CreateArticle(TypeArticle type){
       Article article;
       switch(type){
           case Neuf: article = new ArticleNeuf(sequenceId++);
               break;
           case Occasion: article = new ArticleOccasion(sequenceId++);
               break;
           default: throw new NotImplementedException();
       }
       return article;
   }
    
}
